#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
map<vector<int>,int> mp;
int n,m,p[10],cnt;
struct node{
    int a[121][121];
    inline friend node operator * (node x,node y)
    {
        node res;
        for(int i = 1;i<=cnt;i++)
            for(int j = 1;j<=cnt;j++)
            {
                res.a[i][j] = 0;
                for(int k = 1;k<=cnt;k++)
                    (res.a[i][j]+=1ll*x.a[i][k]*y.a[k][j]%mod)%=mod;
            }
        return res;
    }
}base,x;
inline node qpow(node x,int y)
{
    node res = x;y--;
    while(y)
    {
        if(y&1) res = res*x;
        y>>=1;
        x = x*x;
    }
    return res;
}
signed main()
{
    freopen("drama.in","r",stdin);
    freopen("drama.out","w",stdout);
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n>>m;
    for(int i = 1;i<=n;i++)
        p[i] = i;
    do{
        cnt++;
        vector<int> v;
        for(int i = 1;i<=n;i++) v.push_back(p[i]);
        mp[v] = cnt;
    }while(next_permutation(p+1,p+n+1));
    x.a[1][1] = 1;
    for(auto i:mp)
    {
        vector<int> v;int c;
        v = i.first,c = i.second;
        // for(auto j:v) cout<<j<<' ';
        // cout<<'\n';
        base.a[c][c] = 1;
        for(int i = 0;i<n-1;i++)
            swap(v[i],v[i+1]),base.a[c][mp[v]]++;
    }
    base = qpow(base,m);
    x = x*base;
    cout<<x.a[1][1];
    return 0;
}